#Region "Imports"

Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls

#End Region

Partial Public Class FrmAddOrder_WithoutPageMethods
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim customerID As Integer
        Dim productID As String
        Dim tmp As String

        tmp = Request.QueryString("CustomerID")
        If tmp Is nothing Then
            Throw New Exception("CustomerID parameter is missing.")
        End If

        Try
            customerID = Int32.Parse(tmp)
        Catch x As FormatException
            Throw New Exception("Parameter CustomerID is not in a valid format.")
        End Try

        productID = Request.QueryString("ProductID")
        If productID Is Nothing Then
            Throw New Exception("productID parameter is missing.")
        End If


        ' Real page processing starts here
        ' ...
        Label1.Text = String.Format("Ready to add an order of product {0} for customer {1}.", _
          productID, customerID)
    End Sub
End Class